import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import recruiter from './modules/recruiter'
import seeker from './modules/seeker'
import manager from './modules/manager'
import chat from './modules/chat'


Vue.use(Vuex);

export default new Vuex.Store({
  modules: { recruiter, seeker, manager,chat }, // 注册模块
  plugins: [
    createPersistedState({
      key: 'job-platform',
      paths: ['recruiter', 'seeker',
          'manager.token', 
        'manager.userInfo',
        'manager.onlineUsersMap',
        'manager.allChatRecords',
        'chat'] // 持久化所有模块状态
    })
  ]
});